package com.byxy.action;

import java.util.List;

import javax.annotation.Resource;

import com.byxy.entity.Category;
import com.byxy.entity.Product;
import com.byxy.service.CategoryService;
import com.byxy.service.ProductService;
import com.opensymphony.xwork2.ActionSupport;


public class ProductAction extends ActionSupport {
	@Resource
	private ProductService productService;
	private Integer id;
	private Product	product;
	
	private Integer cid;
	@Resource
	private CategoryService categoryService;

//通过id查询商品
	public String findByid() {
		product=productService.findByid(id);
		return "find";
	}
	//通过分类的id查询商品
	public String findByCid() {
		List<Category> cList=categoryService.findAll();
		return "findByCid";
	}
	
	public Product getProduct() {
		return product;
	}



	public void setProduct(Product product) {
		this.product = product;
	}



	public Integer getId() {
		return id;
	}



	public void setId(Integer id) {
		this.id = id;
	}
	public Integer getCid() {
		return cid;
	}
	public void setCid(Integer cid) {
		this.cid = cid;
	}


}
